<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template name="menu">
	<ul>
		<xsl:choose>
			<xsl:when test="/data/events/front-end-authentication/@status = 'authenticated'">
				<li>
					<em id="signed-in">
						<xsl:value-of select="/data/events/front-end-authentication/@user"/>
						<xsl:text> |</xsl:text>
					</em>
				</li>
				<xsl:if test="/data/clients/entry/client-status/item/@handle = 'active'">
					<li>
						<xsl:if test="$current-page = 'calendar' or $current-page = 'day'">
							<xsl:attribute name="class">active</xsl:attribute>
						</xsl:if>
						<a href="{$root}/">Calendar</a>
					</li>
				</xsl:if>
				<xsl:if test="/data/clients/entry/administrator = 'No'">
					<li>
						<xsl:if test="$current-page = 'archives'">
							<xsl:attribute name="class">active</xsl:attribute>
						</xsl:if>
						<a href="{$root}/archives">Archives</a>
					</li>
				</xsl:if>
				<xsl:if test="/data/clients/entry/client-status/item/@handle != 'closed'">
					<li>
						<xsl:if test="$current-page = 'profile'">
							<xsl:attribute name="class">active</xsl:attribute>
						</xsl:if>
						<a href="{$root}/profile">Profile</a>
					</li>
				</xsl:if>
				<li>
					<a href="{$root}/sign-out/?front-end-authentication-logout=true">Sign Out</a>
				</li>
			</xsl:when>
			<xsl:otherwise>
				<li>
					<em id="signed-out">You are not signed in.</em>
				</li>
			</xsl:otherwise>
		</xsl:choose>
		<xsl:if test="/data/events/login-info/@logged-in = 'true'">
			<li><a href="{$root}/symphony/">Admin</a></li>
			<li><a href="?debug">Debug</a></li>
		</xsl:if>
	</ul>
</xsl:template>

</xsl:stylesheet>